package com.rentalcar.rental_car.service.impl;

import com.rentalcar.rental_car.dao.OrdersMapper;
import com.rentalcar.rental_car.entity.OrderDate;
import com.rentalcar.rental_car.entity.Orders;
import com.rentalcar.rental_car.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    OrdersMapper ordersMapper;

    @Override
    public List<Orders> getOrderAll() {
        return ordersMapper.getOrdersAll();
    }

    @Override
    public List<Orders> selectByStatus(String status) {

        return ordersMapper.selectByStatus(status);
    }

    @Override
    public List<OrderDate> getMountByMonth() {
        return ordersMapper.getMountByMonth();
    }

    @Override
    public int add(Orders orders) {

        return ordersMapper.add(orders);
    }

    @Override
    public int update(Orders orders) {

        return ordersMapper.update(orders);
    }

    @Override
    public int delete(Orders orders) {

        return ordersMapper.delete(orders);
    }

    @Override
    public List<Orders> selectByCustKey(Integer custKey) {

        return ordersMapper.selectByCustKey(custKey);
    }
}
